/*
 * User: user
 * Date: 05/01/2008
 * Time: 23:16:52
 */
package org.conann.instrument;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.security.ProtectionDomain;

public class TestingClassFileTransformer implements ClassFileTransformer {

    private static final Logger log = LoggerFactory.getLogger(TestingClassFileTransformer.class);

    public byte[] transform (ClassLoader loader, String className, Class<?> redefiningClass, ProtectionDomain domain, byte[] bytes) throws IllegalClassFormatException {
        log.debug("Examining " + redefiningClass);
        if (className.contains("conann")) {
            System.out.println("Transforming: " + className);
        }
        return bytes;
    }
}